<template>
  <el-card shadow="never" class="index">
    <el-timeline>
      <el-timeline-item v-for="(approve, index) in processes" icon="MoreFilled" type="primary" size="large" hollow="true"
        :key="index" :timestamp="approve.cDate">{{ approve.position }}</el-timeline-item>
    </el-timeline>
    <el-card v-if="!processes || processes.length < 1">
      没有任何记录
    </el-card>
  </el-card>
</template>

<script>
import { reactive, ref, getCurrentInstance, onBeforeMount } from "vue";
import { MoreFilled } from "@element-plus/icons";
import { approveService } from "../../interfaces/service";
import { ElMessage } from "element-plus";


export default {
  components: { MoreFilled },
  setup() {

    // 发展进程
    let processes = ref([])

    onBeforeMount(() => {
      approveService.process().then(res => {
        if (res.success) {
          console.log(res.data);
          processes.value = res.data;
        }
      }).catch(error => {
        console.log(error);
      });
    });


    return { processes };
  },
};
</script>

<style lang="scss" scoped>
</style>
